 <template>
  <div>
    <!-- $attrs  直接传过去   -->
    <Dialog ref="dialog" v-bind="$attrs" @confirm="confirm">
      <Myform ref="forms" v-bind="$attrs" v-on="$listeners"></Myform>
    </Dialog>
  </div>
</template>

<script>
export default {
  name: "DF",
  data() {
    return {};
  },

  //   assign
  mounted() {
    const { show, hide, start, stop } = this.$refs.dialog;
    Object.assign(this, { show, hide, start, stop });
  },
  methods: {
    /**
     * 点击确认按钮
     */
    async confirm() {
      try {
        await this.$refs.forms.validate();
        this.$emit("confirm");
      } catch (error) {}
    },
  },
};
</script>

<style lang="scss" scoped></style>
